package com.qigao.mall.channel.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author:luiz
 * @Date: 2018/6/1 15:02
 * @Descripton:
 * @Modify :
 **/
@Component
public class ChannelConstant {
    //应用地址
    @Value("${qigao.pay.domain}")
    private  String payDomain;
    @Value("${qigao.sysName}")
    private  String domainName;
    //页面跳转地址
    @Value("${qigao.pay.forwardUrl}")
    private  String forwardUrl;


    //支付宝网关请求地址
    @Value("${qigao.gateway.alipay.url:https://openapi.alipay.com/gateway.do}")
    private   String alipayUrl;
    private   String alipayNotifyUrl="/qigao/aliPayNotify/pay";;
    private String weichatNotifyUrl="/qigao/weichatNotify/pay";
    private String weichatRefundNotifyUrl="/qigao/weichatNotify/refund";

    //支付宝授权URL
    @Value("${qigao.gateway.alipay.auth.url:https://openauth.alipaydev.com/oauth2/publicAppAuthorize.htm}")
    private String alipayAuthUrl;
    //支付宝授权跳转地址
    @Value("${qigao.gateway.alipay.auth.forwardUrl}")
    private  String alipayAuthForwardUrl;

    //微信请求地址
    @Value("${qigao.gateway.weichat.order.url:https://api.mch.weixin.qq.com/pay/unifiedorder}")
    private   String weichatOrderUrl;
    //微信单次分账接口
    @Value("${qigao.gateway.weichat.profit.url:https://api.mch.weixin.qq.com/secapi/pay/profitsharing}")
    private   String profitSharingUrl;
    @Value("${qigao.gateway.weichat.profitAdd.url:https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver}")
    private   String profitAddUrl;
    @Value("${qigao.gateway.weichat.profitRemove.url:https://api.mch.weixin.qq.com/pay/profitsharingremovereceiver}")
    private   String profitRemoveUrl;
    @Value("${qigao.gateway.weichat.order.query.url:https://api.mch.weixin.qq.com/pay/orderquery}")
    private   String weichatOrderQueryUrl;
    @Value("${qigao.gateway.weichat.login.url:https://api.weixin.qq.com/sns/jscode2session}")
    private   String weichatLoginUrl;
    @Value("${qigao.gateway.weichat.token.url:https://api.weixin.qq.com/cgi-bin/token}")
    private   String weichatTokenUrl;
    @Value("${qigao.gateway.open.login.url:https://open.weixin.qq.com/connect/qrconnect}")
    private String weichatOpenLoginUrl;
    @Value("${qigao.gateway.open.login.url:https://api.weixin.qq.com/sns/oauth2/access_token}")
    private String weichatOpenTokenUrl;
    //无限制的二维码生成
    @Value("${qigao.gateway.unlimit.qrcode.url:https://api.weixin.qq.com/wxa/getwxacodeunlimit}")
    private String weichatQrcodeUrl;
    //微信授权跳转地址
    @Value("${qigao.gateway.weichat.auth.forwardUrl}")
    private  String weichatAuthForwardUrl;
    //平台证书序列号
    @Value("${qigao.gateway.weichat.plat.certSn}")
    private  String weichatPlatCertSn;
    @Value("${qigao.gateway.weichat.refund.cert:/home/apps/cert/apiclient_cert.p12}")
    private String weichatRefundCertPath;
    @Value("${qigao.gateway.weichat.refund.url:https://api.mch.weixin.qq.com/secapi/pay/refund}")
    private   String weichatRefundUrl;
    @Value("${qigao.gateway.weichat.refund.query.url:https://api.mch.weixin.qq.com/pay/refundquery}")
    private   String weichatRefundQueryUrl;
    @Value("${qigao.gateway.weichat.uniform.msg.url:https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send}")
    private   String weichatUniformMsgUrl;


    public String getPayDomain() {
        return payDomain;
    }

    public String getDomainName() {
        return domainName;
    }

    public String getAlipayNotifyUrl() {
        return getPayDomain()+alipayNotifyUrl;
    }

    public String getWeichatNotifyUrl() {
        return getPayDomain()+weichatNotifyUrl;
    }


    public String getAlipayAuthForwardUrl() {
        return alipayAuthForwardUrl;
    }

    public String getWeichatAuthForwardUrl() {
        return weichatAuthForwardUrl;
    }

    public String getForwardUrl() {
        return forwardUrl;
    }

    public String getAlipayAuthUrl() {
        return alipayAuthUrl;
    }

    public String getAlipayUrl() {
        return alipayUrl;
    }

    public String getWeichatOrderUrl() {
        return weichatOrderUrl;
    }

    public String getWeichatOrderQueryUrl() {
        return weichatOrderQueryUrl;
    }

    public String getWeichatLoginUrl() {
        return weichatLoginUrl;
    }

    public String getWeichatTokenUrl() {
        return weichatTokenUrl;
    }

    public String getWeichatQrcodeUrl() {
        return weichatQrcodeUrl;
    }
    public String getWeichatOpenLoginUrl() {
        return weichatOpenLoginUrl;
    }

    public String getWeichatOpenTokenUrl() {
        return weichatOpenTokenUrl;
    }

    public String getWeichatRefundUrl() {
        return weichatRefundUrl;
    }

    public String getWeichatRefundNotifyUrl() {
        return getPayDomain()+weichatRefundNotifyUrl;
    }

    public String getWeichatRefundCertPath() {
        return weichatRefundCertPath;
    }

    public String getWeichatRefundQueryUrl() {
        return weichatRefundQueryUrl;
    }

    public String getWeichatPlatCertSn() {
        return weichatPlatCertSn;
    }

    public String getProfitSharingUrl() {
        return profitSharingUrl;
    }

    public String getProfitAddUrl() {
        return profitAddUrl;
    }

    public String getProfitRemoveUrl() {
        return profitRemoveUrl;
    }

    public String getWeichatUniformMsgUrl() {
        return weichatUniformMsgUrl;
    }
}
